package nc.ui.arap.actions.verify;

import nc.bs.logging.Log;
import nc.vo.arap.transaction.VerifyMsg;
import nc.vo.arap.verifynew.DisplayVO;
import nc.vo.arap.verifynew.LogToDisplay;
import nc.vo.verifynew.pub.VerifyLogVO;

/**
 * nc.ui.arap.actions.verify.VerifyManualAction
 *
 * @author twei
 *
 */
public class VerifyManualAction extends VerifyBaseAction {
	
	public void execute(Boolean b){
		
		if(!b || this.getCom().getM_logs().size()==0){
			
			getNormalPanel().showHintMessage(VerifyMsg.getm_sVerifyFail());
			
			return;
			
		}
		try{
			String hxpch=getCom().save();
			VerifyLogVO[] vos =new VerifyLogVO[this.getCom().getM_logs().size()];
			this.getCom().getM_logs().toArray(vos);
			DisplayVO[] display=LogToDisplay.getDiaplayVOSum(vos);
			if(display != null && display.length>0){
				for(int i=0;i<display.length;i++){
				    	display[i].setM_clbh(hxpch);
				}
			}
			
			getNormalPanel().onTrans2SumPanel("VerifytoSum",display);
			
			this.getCom().clearAll();
			
		}catch(Exception e){
			Log.getInstance(this.getClass()).error(e.getMessage(), e);
			getPanel().showErrorMessage(e.getMessage());
		}finally{
			getPanel().freeLock();
		}
	}

}
